// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Author: Huawei OS Kernel Lab
 * Create: Thu Aug 15 16:14:23 2023
 */

#include <linux/mm_types.h>
#include <linux/jump_label.h>
#include <liblinux/unimpl.h>

/* mmu_context.c */
LIBLINUX_GPL_EXPORTED_UNIMPL(use_mm);
LIBLINUX_GPL_EXPORTED_UNIMPL(unuse_mm);

LIBLINUX_EXPORTED_UNIMPL(kmsg_dump);

LIBLINUX_EXPORTED_UNIMPL_RET(remap_vmalloc_range, int, 0);

LIBLINUX_EXPORTED_UNIMPL_RET(valid_mmap_phys_addr_range, int, 0);
LIBLINUX_EXPORTED_UNIMPL_RET(vmalloc_user, int, 0);

LIBLINUX_EXPORTED_UNIMPL(v7_flush_kern_cache_all);
LIBLINUX_EXPORTED_UNIMPL(adjust_managed_page_count);

LIBLINUX_UNIMPL_RET(memblock_add, int, 0);
LIBLINUX_UNIMPL_RET(memblock_mark_hotplug, int, 0);
LIBLINUX_UNIMPL_RET(memblock_remove, int, 0);
LIBLINUX_UNIMPL_RET(memblock_reserve, int, 0);

LIBLINUX_EXPORTED_UNIMPL(flush_dcache_page);

/* mm/oom_kill.c */
LIBLINUX_UNIMPL_RET(find_lock_task_mm, void *, NULL);

LIBLINUX_UNIMPL(zone_watermark_ok_safe);
LIBLINUX_UNIMPL(zone_watermark_ok);
LIBLINUX_UNIMPL(mte_sync_tags);
LIBLINUX_UNIMPL(__sync_icache_dcache);
LIBLINUX_UNIMPL(set_swapper_pgd);
LIBLINUX_EXPORTED_UNIMPL_RET(ptep_set_access_flags, int, 1);
LIBLINUX_UNIMPL_RET(__oom_reap_task_mm, bool, true);
LIBLINUX_UNIMPL(cap_vm_enough_memory);
LIBLINUX_UNIMPL(mte_copy_page_tags);
LIBLINUX_UNIMPL(vm_area_free);
LIBLINUX_UNIMPL(vmacache_update);
LIBLINUX_UNIMPL(vm_area_dup);
LIBLINUX_UNIMPL(cap_mmap_addr);

/* mm/vmstat.c */
struct workqueue_struct *mm_percpu_wq;
LIBLINUX_UNIMPL(refresh_zone_stat_thresholds);
LIBLINUX_UNIMPL(cpu_vm_stats_fold);
LIBLINUX_UNIMPL(quiet_vmstat);
LIBLINUX_UNIMPL(drain_zonestat);

LIBLINUX_UNIMPL(vmacache_find);
LIBLINUX_UNIMPL_RET(sve_verify_vq_map, int, 0);
LIBLINUX_UNIMPL(sve_update_vq_map);
unsigned long mmap_min_addr;
EXPORT_SYMBOL(mmap_min_addr);
unsigned long dac_mmap_min_addr;
EXPORT_SYMBOL(dac_mmap_min_addr);

DEFINE_STATIC_KEY_FALSE(arm64_const_caps_ready);
EXPORT_SYMBOL(arm64_const_caps_ready);

bool arm64_use_ng_mappings;
EXPORT_SYMBOL(arm64_use_ng_mappings);

DECLARE_BITMAP(cpu_hwcaps, ARM64_NCAPS);
EXPORT_SYMBOL(cpu_hwcaps);

pgd_t swapper_pg_dir[PTRS_PER_PGD];
pgd_t idmap_pg_dir[PTRS_PER_PGD];
EXPORT_SYMBOL(swapper_pg_dir);
EXPORT_SYMBOL(idmap_pg_dir);

s32 vm_committed_as_batch = 32;
EXPORT_SYMBOL(vm_committed_as_batch);

DEFINE_STATIC_KEY_ARRAY_FALSE(cpu_hwcap_keys, ARM64_NCAPS);
EXPORT_SYMBOL(cpu_hwcap_keys);

/* mm/mm_init.c */
LIBLINUX_UNIMPL(mm_compute_batch);

/* mm/page_alloc.c */
LIBLINUX_UNIMPL(drain_local_pages);
